import { Entity, PrimaryGeneratedColumn, Column, OneToOne, JoinColumn } from 'typeorm'
import { UserEntity } from './user.entity'
@Entity({ name: 'userExtend' })
export class UserExtendEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键id'
  })
  id: number

  @Column({
    type: "varchar",
    unique: false,
    nullable: true,
    name: 'qq',
    comment: 'qq账号'
  })
  qq: string

  @Column({
    type: 'varchar',
    unique: false,
    nullable: true,
    name: 'address',
    comment: '地址'
  })
  address: string

  @OneToOne(type => UserEntity, user => user.userExtend)
  @JoinColumn()
  user: UserEntity
}